using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity;
using System.Linq;

namespace MesDAL.DBInfo
{
    public partial class ServerEFModel : DbContext
    {
        public ServerEFModel()
            : base("name=ServerEFModel")
        {
        }

        public virtual DbSet<electrode_info> electrode_info { get; set; }
        public virtual DbSet<equipnetsetting_info> equipnetsetting_info { get; set; }
        public virtual DbSet<machine_info> machine_info { get; set; }
        public virtual DbSet<machinestate_log> machinestate_log { get; set; }
        public virtual DbSet<processsheet_log> processsheet_log { get; set; }
        public virtual DbSet<produceplan_log> produceplan_log { get; set; }
        public virtual DbSet<workpiece_info> workpiece_info { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<electrode_info>()
                .Property(e => e.electrode_code)
                .IsUnicode(false);

            modelBuilder.Entity<equipnetsetting_info>()
                .Property(e => e.equip_num)
                .IsUnicode(false);

            modelBuilder.Entity<equipnetsetting_info>()
                .Property(e => e.ip_config)
                .IsUnicode(false);

            modelBuilder.Entity<machine_info>()
                .Property(e => e.machine_num)
                .IsUnicode(false);

            modelBuilder.Entity<machine_info>()
                .Property(e => e.machine_name)
                .IsUnicode(false);

            modelBuilder.Entity<machine_info>()
                .Property(e => e.machine_state)
                .IsUnicode(false);

            modelBuilder.Entity<machine_info>()
                .Property(e => e.machine_supplier)
                .IsUnicode(false);

            modelBuilder.Entity<machine_info>()
                .Property(e => e.machine_class)
                .IsUnicode(false);

            modelBuilder.Entity<machinestate_log>()
                .Property(e => e.machine_num)
                .IsUnicode(false);

            modelBuilder.Entity<machinestate_log>()
                .Property(e => e.before_state)
                .IsUnicode(false);

            modelBuilder.Entity<machinestate_log>()
                .Property(e => e.after_state)
                .IsUnicode(false);

            //modelBuilder.Entity<processsheet_log>()
            //    .Property(e => e.workpiece_number)
            //    .IsUnicode(false);

            modelBuilder.Entity<processsheet_log>()
                .Property(e => e.name)
                .IsUnicode(false);

            modelBuilder.Entity<processsheet_log>()
                .Property(e => e.isfinish)
                .IsUnicode(false);

            modelBuilder.Entity<processsheet_log>()
                .Property(e => e.content)
                .IsUnicode(false);

            modelBuilder.Entity<produceplan_log>()
                .Property(e => e.machine_num)
                .IsUnicode(false);
            modelBuilder.Entity<produceplan_log>()
                .Property(e => e.discontinuous_date)
                .IsUnicode(false);

            modelBuilder.Entity<workpiece_info>()
                .Property(e => e.number)
                .IsUnicode(false);

            modelBuilder.Entity<workpiece_info>()
                .Property(e => e.size)
                .IsUnicode(false);

            modelBuilder.Entity<workpiece_info>()
                .Property(e => e.name)
                .IsUnicode(false);

            modelBuilder.Entity<workpiece_info>()
                .Property(e => e.order)
                .IsUnicode(false);

            modelBuilder.Entity<workpiece_info>()
                .Property(e => e.deadline)
                .IsUnicode(false);

            modelBuilder.Entity<workpiece_info>()
                .Property(e => e.material)
                .IsUnicode(false);
        }
    }
}
